﻿function AzureTableFilterCombineExpression(leftExpr, op, rightExpr) {

    this.left = leftExpr;

    this.right = rightExpr;

    this.operator = op;

    this.type = 'combine';

    this.match = function (rec) {
        switch (this.operator) {
            case 'or':
                if (this.left.match(rec)) return true;
                return this.right.match(rec);
            case 'and':
                if (!this.left.match(rec)) return false;
                return this.right.match(rec);
            default:
                throw new Error('unknown operator');
        }
    };
}